﻿Imports System
Imports System.Collections
Imports System.Text
Imports System.Configuration
Imports System.Xml
Namespace OpenArchive
    Namespace System
        Namespace Configuration
            Public Class ArchiveConfigElement
                Inherits ConfigurationElement
                Public Sub New()
                End Sub 'New
                Public Sub New(ByVal ArchiveName As String, ByVal ArchiveLocation As String)
                    Name = ArchiveName
                    Location = ArchiveLocation
                End Sub 'New
                Public Sub New(ByVal elementName As String)
                    Name = elementName
                End Sub 'New
                <ConfigurationProperty("name", DefaultValue:="MyArchiv", IsRequired:=True, IsKey:=True)> _
                    Public Property Name() As String
                    Get
                        Return CStr(Me("name"))
                    End Get
                    Set(ByVal value As String)
                        Me("name") = value
                    End Set
                End Property
                <ConfigurationProperty("location", IsRequired:=True)> _
                Public Property Location() As String
                    Get
                        Return CStr(Me("location"))
                    End Get
                    Set(ByVal value As String)
                        Me("location") = value
                    End Set
                End Property
                Protected Overrides Sub DeserializeElement(ByVal reader As XmlReader, ByVal serializeCollectionKey As Boolean)
                    MyBase.DeserializeElement(reader, serializeCollectionKey)
                End Sub

                Protected Overrides Function SerializeElement(ByVal writer As XmlWriter, ByVal serializeCollectionKey As Boolean) As Boolean
                    Return MyBase.SerializeElement(writer, serializeCollectionKey)
                End Function 'SerializeElement

                Protected Overrides Function IsModified() As Boolean
                    Return MyBase.IsModified()
                End Function 'IsModified
            End Class
        End Namespace
    End Namespace
End Namespace